package com.atguigu.springcloud.service;

import com.atguigu.springcloud.entities.Employee;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created by luojie on 2018/9/20.
 */
//@FeignClient(value = "MICROSERVICECLOUD-DEPT")
@FeignClient(value = "MICROSERVICECLOUD-DEPT", fallbackFactory = EmployeeClientServiceFallbackFactory.class)
public interface EmployeeClientService {

    @RequestMapping(value = "/employee/get/{id}", method = RequestMethod.GET)
    Employee findById(@PathVariable("id") String id);

    @RequestMapping(value = "/employee/add", method = RequestMethod.POST)
    Employee save( Employee employee);
}
